package com.example.mvplogin.database;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;


//此类为接口
@Dao
public interface StudentDao {

    //插入
    @Insert
    public  void insertStudent(Student... students);

    //更新
    @Update
    public void updateStudent(Student... students);

    //删除
    @Delete
    public void deleteStudent(Student... students);

    //删除所有
    @Query("DELETE FROM student")
    public void deleteAll();

    //查找,正序查找
    @Query("SELECT * FROM student ORDER BY ID DESC")
    public List<Student> findAll();
}
